home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 17 / AMIGAplus Sonderheft 17 (1999)(ICP)(DE)[!].iso / Rexx / savenode.rexx < prev    next >
OS/2 REXX Batch file  |  1994-08-29  |  2KB  |  39 lines

  1. /* savenode.rexx                                                        */
  2. /* by Edd Dumbill                                                       */
  3. /* 2 July 1994                                                          */
  4. /* returns a document from GoldED to Heddley                            */
  5. /* use this macro as a basis for interfacing with other aynschronous    */
  6. /* text editors.                                                        */
  7.  
  8. OPTIONS RESULTS                             /* enable return codes      */
  9.  
  10. if (LEFT(ADDRESS(), 6) ~= "GOLDED") then    /* not started by GoldEd ?  */
  11.     address 'GOLDED.1'
  12.  
  13. 'LOCK CURRENT'                              /* lock GUI, gain access    */
  14. OPTIONS FAILAT 6                            /* ignore warnings          */
  15. SIGNAL ON SYNTAX                            /* ensure clean exit        */
  16. SIGNAL ON FAILURE                           /* trap Heddley errors      */
  17.  
  18. SAVE NAME 'T:temp_node'                     /* save document text back  */
  19. address 'HEDDLEY.1'                         /* talk to Heddley          */
  20. EDIT LOADTEXT 'T:temp_node'                 /* reload document text     */
  21. LOCK UNLOCK                                 /* unlock front panel       */
  22. address 'GOLDED.1'                          /* talk to GoldED           */
  23.  
  24. 'UNLOCK'                                  /* VERY important: unlock GUI */
  25. EXIT                                        /* quit this macro          */
  26.  
  27. SYNTAX:                                     /* ARexx error...           */
  28.  
  29. SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) /* report it...          */
  30. UNLOCK                                      /* unlock GUI               */
  31. EXIT                                        /* exit                     */
  32.  
  33. FAILURE:                                    /* Heddley error...         */
  34. ERRV=address().LASTERROR                    /* get name of error var.   */
  35. SAY "Error:" VALUE(ERRV)                    /* report the error         */
  36. ADDRESS GOLDED.1                            /* talk to GoldED           */
  37. UNLOCK                                      /* unlock GUI               */
  38. EXIT                                        /* exit                     */
  39.